home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1995 November
/
EnigmA AMIGA RUN 02 (1995)(G.R. Edizioni)(IT)[!][issue 1995-11][Skylink CD].iso
/
earcd
/
util
/
cli
/
0utils.lha
/
0Utils
/
WriteLn.data
< prev
next >
Wrap
Text File
|
1995-08-19
|
2KB
|
79 lines
#ifdef TPLTER
WriteLn = {
Short = {{ Write a line of text to a specified _Filehandle_ }};
description = {{
WriteLn is a bit superfluous, since all U can
do with it can easily - and perhaps better -
be achieved with the use of echo and output
redirection ('>>') (expect for the case, we
try to redirect to things like CON:...).
WriteLn just copies a string to a filehandle that
was previousy opened with 'Open'; it is part of
the archive just for completeness: if we have a
open/close/read, everyone can also expect a 'write'.
ReadLn does no checks on the given filehandle, so
it should be used carefully.
RESULT
-/-
}};
Notes = {{
WriteLn is highly dangerous! Do not Use it,
if U do not exactly know what U are doing!
}};
Examples = {{
> set fh `Open T:writetest WRITE`
> WriteLn $fh This is a test
> Close $fh
> Unset fh
> cat T:writetest
This is a test
}};
HISTORY = {{
21-02-95 b_noll created
21-02-95 b_noll added version/format-prefix/offset
20-03-95 b_noll added args diagnostics
20-03-95 b_noll fixed an error - writeln in fact never worked
19-08-95 b_noll created .data file
}};
Template = "FILEHANDLE/N/A,NOLINE/S,TEXT/F";
Arguments = {{
BPTR *filehandle;
ULONG noline;
STRPTR text;
}};
version = "1.1";
body = {{
if (argv->filehandle && *argv->filehandle) {
/* MISSING: CHECKREGISTER(*argv->filehandle); */
if (FPrintf(*argv->filehandle, argv->noline? "%s": "%s\n", argv->text) >= 0) {
if (!argv->noline || Flush (*argv->filehandle))
retval = RETURN_OK;
} else {
//PrintFault(IoErr(), "WRITE");
} /* if */
} else {
//PrintFault(ERROR_BAD_NUMBER, "WRITE");
SetIoErr(ERROR_BAD_NUMBER);
} /* if */
}};
};
#endif